package com.test.thread.executorservice;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by jl on 2019/5/8 0008
 */
public class SubThreadExpceptionDemo {
    public static void main(String[] args) {
        Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtExceptionHandler());
        ExecutorService exec = Executors.newCachedThreadPool();
        int i = 10;
        while (i > 0) {
            i--;
            exec.execute(()->{
                throw new RuntimeException("sds");
            });
        }
        exec.shutdown();
    }
}
